
var util = require('./util/util');
var config = require('./config');

// 显示成功提示
var showSuccess = text => wx.showToast({
    title: text,
    icon: 'success',
    duration: 1000  
});
var showLoading = text => wx.showToast({
  title: text,
  icon: 'loading',
  duration: 1000  
});  

// 显示失败提示
var showModel = (title, content) => {
    wx.hideToast();
    wx.showModal({
        title,
        content: content,
        showCancel: false
    });
};

App({    
  showLoading: function (text) { 
    showLoading(text);
  },
  showSuccess: function (text) { 
    showSuccess(text);
  },
  showModel: function (title, content) { 
    showModel(title, content);
  },
  formatDateTime: function (date){
      util.formatDateTime(date)
  },
  globalData: { 
    product_list_url : config.service.product_list_url,
    product_detail_url: config.service.product_detail_url,
    doctor_list_url: config.service.doctor_list_url,
    doctor_detail_url: config.service.doctor_detail_url,
    user_login_url: config.service.user_login_url,
    user_register_url: config.service.user_register_url,
    user_detail_url: config.service.user_detail_url, 
    user_exit_url: config.service.user_exit_url, 
    user_update_url: config.service.user_update_url, 
    appointment_add_url: config.service.appointment_add_url, 
    appointment_mylist_url: config.service.appointment_mylist_url,
    message_add_url: config.service.message_add_url, 
    message_mylist_url: config.service.message_mylist_url, 
    message_mydetail_url: config.service.message_mydetail_url,
    message_last_url : config.service.message_last_url,
    buy_add_url: config.service.buy_add_url, 
    buy_doing_url: config.service.buy_doing_url, 
    buy_done_url: config.service.buy_done_url, 
    buy_commit_url: config.service.buy_commit_url, 
    buy_cancel_url: config.service.buy_cancel_url, 
    buy_buy_url: config.service.buy_buy_url, 
  }
})
